<title>用户组权限</title>
  
<div class="layui-card layadmin-header">
  <div class="layui-breadcrumb" lay-filter="breadcrumb">
    <a lay-href="">主页</a>
    <a><cite>问答管理</cite></a>
    <a><cite>用户管理</cite></a>
    <a><cite>用户组权限</cite></a>
  </div>
</div>

  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">
        <div class="layui-card">
        	<div class="layui-card-header"><a lay-href="wendasns/group/index?type={$group.type}" style="color: #990000;margin-right: 10px;">&lt;&lt; 返回上一级</a></div>
		    <div id="J_card_show" class="layui-card-body"></div>
  		</div>
  	</div>
  </div>
</div>


<script>
;!function(){
  var $ = layui.$
  ,admin = layui.admin
  ,view = layui.view
  ,form = layui.form;


	var html = $('#J_{$group.type}_view').html();console.log($('#J_{$group.type}_view'));
	view('J_card_show').send(html, {});
	form.render();

}();
</script>

<script type="text/html" id="J_default_view">
<form class="layui-form" action="{:url('wendasns/group/dorun')}" method="post">
  <input type="hidden" name="id" value="{$group.id}">
  
            <div class="layui-form-item">
              <label class="layui-form-label">用户组名称</label>
              <div class="layui-input-inline">
                <input type="text" name="name" value="{$group.name}" lay-verify="required" class="layui-input">
              </div>
              
            </div>
<hr>
{volist name="rank" id="item"}
	{if $item.type eq 'default'}
        <div class="layui-form-item">
          <label class="layui-form-label">{$item.name}</label>
          <div class="layui-input-inline">
			<input type="checkbox" name="auths[]" value="{$item.controller}" lay-skin="primary" title="启用" {if in_array($item.controller,$controller)}checked{/if}>
          </div>
          <div class="layui-form-mid layui-word-aux">{$item.content}</div>
        </div>
	{/if}
{/volist}
        
            <div class="layui-form-item">
              <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="J_ajax_submit_btn">提交</button>
              </div>
            </div>
            
          </form>
</script>

<script type="text/html" id="J_admin_view">
<form class="layui-form" action="{:url('wendasns/group/dorun')}" method="post">
  <input type="hidden" name="id" value="{$group.id}">
  
            <div class="layui-form-item">
              <label class="layui-form-label">用户组名称</label>
              <div class="layui-input-inline">
                <input type="text" name="name" value="{$group.name}" lay-verify="required" class="layui-input">
              </div>
            </div>
<hr>
{volist name="rank" id="item"}
	{if $item.type eq 'admin'}
        <div class="layui-form-item">
          <label class="layui-form-label">{$item.name}</label>
          <div class="layui-input-inline">
			<input type="checkbox" name="auths[]" value="{$item.controller}" lay-skin="primary" title="启用" {if in_array($item.controller,$controller)}checked{/if}>
          </div>
          <div class="layui-form-mid layui-word-aux">{$item.content}</div>
        </div>
	{/if}
{/volist}
        
            <div class="layui-form-item">
              <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="J_ajax_submit_btn">提交</button>
              </div>
            </div>
            
          </form>
</script>